home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1999 March / EnigmA AMIGA RUN 35 (1999)(G.R. Edizioni)(IT)[!][issue 1999-03].iso / earcd / devel / libx11 / include / x11 / xkw / handp.h < prev    next >
C/C++ Source or Header  |  1999-01-01  |  4KB  |  132 lines

  1. /*
  2.  * $XConsortium: HandP.h,v 1.9 91/07/26 15:21:49 keith Exp $
  3.  */
  4.  
  5. /* 
  6.  * HandP.h - Private definitions for Hand widget
  7.  */
  8.  
  9. #ifndef _XtHandP_h
  10. #define _XtHandP_h
  11.  
  12. #include "Hand.h"
  13. #include <X11/Xaw/SimpleP.h>
  14.  
  15. /***********************************************************************
  16.  *
  17.  * Hand Widget Private Data
  18.  *
  19.  ***********************************************************************/
  20.  
  21. /************************************
  22.  *
  23.  *  Class structure
  24.  *
  25.  ***********************************/
  26.  
  27. /*
  28.  * New fields for the Hand widget class record
  29.  */
  30.  
  31. typedef struct _HandClass {
  32.     int        makes_compiler_happy;  /* not used */
  33. } HandClassPart;
  34.  
  35. /*
  36.  * Full class record declaration
  37.  */
  38.  
  39. typedef struct _HandClassRec {
  40.     CoreClassPart    core_class;
  41.     SimpleClassPart    simple_class;
  42.     HandClassPart    hand_class;
  43. } HandClassRec;
  44.  
  45. extern HandClassRec handClassRec;
  46.  
  47. /***************************************
  48.  *
  49.  *  Instance (widget) structure 
  50.  *
  51.  **************************************/
  52.  
  53. /*
  54.  * New fields for the Hand widget record
  55.  */
  56.  
  57. #define New(t) (t *) malloc(sizeof (t))
  58. #define Dispose(p)  free((char *) p)
  59. #define Some(t,n)   (t*) malloc(sizeof(t) * n)
  60. #define More(p,t,n) ((p)? (t *) realloc((char *) p, sizeof(t)*n):Some(t,n)
  61.  
  62. typedef enum { ClipUnclipped, ClipPartclipped, ClipAllclipped } HandClip;
  63.  
  64. typedef struct _Card {
  65.     struct _Card    *next, *prev;
  66.     Boolean        redisplay;        /* temp for redisplay routine */
  67.     Boolean        isUp;
  68.     Boolean        shouldBeUp;
  69.     Boolean        delete;
  70.     Boolean        forceRedraw;
  71.     XRectangle        clip;
  72.     HandClip        clipped;
  73.     XtPointer        private;
  74.     int            row, col;
  75.     int            offset;
  76.     int            x, y;
  77. } CardRec, *CardPtr;
  78.  
  79. typedef struct _Erased {
  80.     struct _Erased  *next;
  81.     XRectangle        r;
  82.     Bool        fill;
  83.     Bool        isCard;
  84.     int            cardX, cardY;
  85. } ErasedRec, *ErasedPtr;
  86.  
  87. typedef struct {
  88.     /*
  89.      * Resource specifiable values
  90.      */
  91.     Dimension        card_width;        /* area occupied by card */
  92.     Dimension        card_height;    /*  */
  93.     Dimension        internal_border;    /* space around entire hand */
  94.     Dimension        num_cols;        /* number of columns */
  95.     Dimension        num_rows;        /* number of rows */
  96.     Dimension        col_offset;        /* distance to space columns apart */
  97.     Dimension        row_offset;        /* distance to space rows apart */
  98.     Position        display_x;        /* inside display rectangle, */
  99.     Position        display_y;        /*  the display func will fill */
  100.     Dimension        display_width;    /*  the entire space.  Used to */
  101.     Dimension        display_height;    /*  optimize redisplay */
  102.     Boolean        cols_hint;        /* number of columns is only a hint */
  103.     Boolean        rows_hint;        /* number of rows is only a hint */
  104.     Boolean        row_insert;        /* when inserting cards, those on */
  105.     Boolean        col_insert;        /*  top get moved down/right */
  106.     Boolean        immediate_update;    /* redisplay after every edit */
  107.     Boolean        row_major;        /* stack cards in cols */
  108.     XtCallbackList  display_callback;    /* func to display cards */
  109.     XtCallbackList  input_callback;    /* func called on button press */
  110.     /* List of cards could be changed by resource, but easier by func */
  111.     CardPtr        topCard, bottomCard;/* list of cards */
  112.     Dimension        real_col_offset;    /* when widget gets reshaped, */
  113.     Dimension        real_row_offset;    /*  the offset values are adjusted */
  114.     ErasedPtr        erased;        /* list of areas erased; for redisplay*/
  115.     XExposeEvent    lastExpose;        /* last rectangle exposed */
  116.     unsigned long   exposeTime;        /* serial number when exposed */
  117. } HandPart;
  118.  
  119. /*
  120.  * Full widget declaration
  121.  */
  122.  
  123. typedef struct _HandRec {
  124.     CorePart    core;
  125.     SimplePart    simple;
  126.     HandPart    hand;
  127. } HandRec;
  128.  
  129. #endif /* _XtHandP_h */
  130.  
  131.  
  132.